import { Column, ManyToOne, Entity } from "typeorm";
import { UserEntity } from "./user.entity";
import { CommonEntity } from "./common.entity";
import { Exclude } from "class-transformer";
import { ApiProperty } from "@nestjs/swagger";

@Entity({ name: "user_collect" })
export class CollectEntity extends CommonEntity {
    @ApiProperty({ description: "收藏内容, 文件路径" })
    @Column()
    content: string;

    @Exclude()
    @ManyToOne((type) => UserEntity, (user) => user.collects)
    user: UserEntity;
}
